fix: repair cross-package bugs so all tests pass - #89
Open
stooit wants to merge 1 commit into
Open
Conversation
- fix stale useThrottle import in apps/web/src/lib/api.ts to use useDebounce, keeping the useSearchDebounce public alias intact - forward aria-label on icon-only Button for an accessible name (WCAG 4.1.2) - use en-AU dateStyle:short in formatDate so day 1 is not confused with month 1 (day-first, non-ambiguous ordering) No test files modified, no new dependencies. All 13 tests pass across packages/ui, packages/utils, apps/web; tsc clean (except pre-existing bun:test env resolution errors).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes all failing tests and the real type error across the monorepo. 13/13 tests now pass in
packages/ui,packages/utils, andapps/web;tsc --noEmitis clean (aside from the pre-existingbun:testmodule-resolution errors, which are an environment quirk unrelated to these bugs).Bugs fixed
apps/web/src/lib/api.ts) — the file imported the renamed/removeduseThrottlefrom@e2e/utils, causingTS2305and breakingapps/web/test/api.test.ts. Switched to the correctuseDebounceand kept theuseSearchDebouncepublic alias that the test asserts.packages/ui/src/components/Button/Button.tsx) —aria-labelwas not forwarded, so an icon-only button had no accessible name (WCAG 4.1.2). Now forwardsaria-label; the no-label case still renders (with a dev warning) as the test expects.packages/utils/src/format/date.ts) —formatDateproduced zero-padded, ambiguous output (01/03/2024) so "day 1" could be confused with "month 1". Switched to an en-AU day-first short style so the day is non-zero-padded and unambiguous.Verification
packages/ui: 6 pass / 0 failpackages/utils: 5 pass / 0 failapps/web: 2 pass / 0 fail./node_modules/.bin/tsc --noEmit: no errors except the pre-existingbun:testenv resolution errorsConstraints honoured
Assumptions
Cannot find module 'bun:test'tsc errors are an environment/type-resolution quirk, not part of the assigned bugs, so they were left untouched.useSearchDebounce(as asserted by the test), backed by theuseDebounceimplementation.